
var invertTree = function(root) {
  // if(!root) return root
  // let temp = null
  // temp = root.left
  // root.left = root.right
  // root.right = temp
  // invertTree(root.left)
  // invertTree(root.right)
  // return root
  if(!root) return root
  let left = invertTree(root.left)
  let right = invertTree(root.right)
  root.left = right
  root.right = left
  return root
};